package seday02;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteString {
    public static void main(String[] args) throws IOException {
        /*FileOutputStream fos = new FileOutputStream("demo.txt");
        fos.write("今天天气真好！".getBytes(StandardCharsets.UTF_8));
        System.out.println("写出成功");
        fos.close();*/

        FileOutputStream fos = new FileOutputStream("demo.txt",true);
        fos.write("好好学习，天天向上！".getBytes(StandardCharsets.UTF_8));
        fos.close();
        fos = new FileOutputStream("demo.txt",true);
        fos.write("好好上班，努力赚钱！".getBytes(StandardCharsets.UTF_8));
        fos.close();
    }
}
